package com.wf.course.service.impl;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.wf.course.dao.IUserRoleRelationMapper;
import com.wf.course.model.user.UserRoleRelation;
import com.wf.course.service.IUserRoleRelationService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
@Transactional(rollbackFor=Exception.class)
public class IUserRoleRelationServiceImpl implements IUserRoleRelationService{

	@Autowired
	private IUserRoleRelationMapper iUserRoleRelationMapper;
	
	public List<UserRoleRelation> getByUserID(Integer userID) {
		return iUserRoleRelationMapper.getByUserIDorRoleID(userID, 1);
	}

	public List<UserRoleRelation> getByRoleID(Integer roleID) {
		return iUserRoleRelationMapper.getByUserIDorRoleID(roleID, 2);
	}

}
